<?php
class Status {
    const CODE_NEXT_NOT_FOUND = 1;
    const CODE_TOPIC_NOT_FOUND_IN_ROWS = 2;
    const CODE_TOPIC_FOUND = 3;
    const CODE_TOPIC_NOT_FOUND_IN_PAGE = 4;
    const CODE_TOPC_NOF_FOUND_FIRST_PAGE = 5;
    
    const DESCR_NEXT_NOT_FOUND = 'Next not found';
    const DESCR_TOPIC_NOT_FOUND_IN_ROWS = 'Topic not found';
    const DESCR_TOPIC_FOUND = 'Topic found';
    const DESCR_TOPIC_NOT_FOUND_IN_PAGE = "Topic not found in page";
    const DESCR_TOPIC_NOT_FOUND_FIRST_PAGE = 'Topic not found in first page';
    
    protected $code;
    protected $status;
    protected $currentPage;
    protected $currentRow;
    
    protected $rawInfos;
    
    function __construct($c, $s, $cP = null, $cR = null) {
        $this->code = $c;
        $this->status = $s;
        $this->currentPage = $cP;
        $this->currentRow = $cR;
    }
    
    static function status($c, $s, $cP = null, $cR = null) {
        return new Status($c, $s, $cP, $cR);
    }
    
    public function setRawInfo($key, $value) {
        $this->rawInfos[$key] = $value;
    }
    
    public function getRawInfos() {
        return $this->rawInfos;
    }  
}
?>